﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DBBase;

namespace Business
{
    public partial class jcxm : Form
    {
        public string sjcxm;
        public string sbs;

        public jcxm(string jcxm, string bs, bool fj, string lsh)
        {
            InitializeComponent();
            sjcxm = jcxm;
            sbs = bs;
        }

        private void jcxm_Load(object sender, EventArgs e)
        {
            if (sbs.Contains("0"))
            {
                OK.Enabled = false;
            }
            else
            {
                OK.Enabled = true;
            }

            if (sjcxm.Contains("S1"))
            {
                che_cheshu.Checked = true;
            }

            if (sjcxm.Contains("A1"))
            {
                check_chehua.Checked = true;
            }
            if (sjcxm.Contains("B1"))
            {
                che_yzdd.Checked = true;
            }
            if (sjcxm.Contains("B2"))
            {
                che_ezzd.Checked = true;
            }
            if (sjcxm.Contains("B3"))
            {
                che_szzd.Checked = true;
            }
            if (sjcxm.Contains("B0"))
            {
                che_yzzc.Checked = true;
            }
            if (sjcxm.Contains("SJ"))
            {
                che_lb.Checked = true;
            }
            if (sjcxm.Contains("F1"))
            {
                che_waiguan.Checked = true;
            }
            if (sjcxm.Contains("C1"))
            {
                check_dipan.Checked = true;
            }
            if (sjcxm.Contains("DC"))
            {
                che_dongtai.Checked = true;
            }

            if (sjcxm.Contains("H1"))
            {
                chb_左灯.Checked = true;
            }
            if (sjcxm.Contains("H4"))
            {
                chb_右灯.Checked = true;
            }
            
        }

        private void OK_Click(object sender, EventArgs e)
        {
            sjcxm = "";
            if (che_cheshu.Checked)
            {
                sjcxm = sjcxm + "S1,";
            }
            if (che_yzdd.Checked)
            {
                sjcxm = sjcxm + "B1,";
            }
            if (che_ezzd.Checked)
            {
                sjcxm = sjcxm + "B2,";
            }
            if (che_szzd.Checked)
            {
                sjcxm = sjcxm + "B3,";
            }
            if (che_yzzc.Checked)
            {
                sjcxm = sjcxm + "B0,";
            }
            if (check_chehua.Checked)
            {
                sjcxm = sjcxm + "A1,";
            }
            if (che_lb.Checked)
            {
                sjcxm = sjcxm + "SJ,";
            }
            if (che_waiguan.Checked)
            {
                sjcxm = sjcxm + "F1,";
            }
            if (che_dongtai.Checked)
            {
                sjcxm = sjcxm + "DC,";
            }
            if (check_dipan.Checked)
            {
                sjcxm = sjcxm + "C1,";
            }

            if (chb_左灯.Checked)
            {
                sjcxm = sjcxm + "H1,";
            }
            if (chb_右灯.Checked)
            {
                sjcxm = sjcxm + "H4,";
            }
            DialogResult = DialogResult.OK;
            this.Close();
        }

    }
}
